package com.ruoyi.web.controller.example;


import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.example.service.INewStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Anonymous
@RestController
@RequestMapping("/newstudent")
public class NewStudentController extends BaseController {

    @Autowired
    private INewStudentService studentService;

    @GetMapping("/list")
    private AjaxResult list() {

        String allStudents =  studentService.getStudents();

        return "".equals(allStudents) ?
                AjaxResult.error("取得所有学生失败"):
                AjaxResult.success();
    }
}

